]> permondes.de Git - Analog_Engine.git/blame - scripts/TP1 05.15 Comet.AESL
Potentials and Motion
[Analog_Engine.git] / scripts / TP1 05.15 Comet.AESL
CommitLineData
a24f7a5c
P
1IDENTIFICATION DIVISION
2PROGRAM-ID Comet
3VERSION 20240205
4COMMENT A comet moves on a parabolic orbit in the gravitational field of the stationary sun.
5COMMENT Its orbital plane coincides with the plane of the Earth's orbit, which is assumed to be circular.
6COMMENT The perihelion distance is one third of the Earth's orbital radius R.E.
7COMMENT How long does the comet move within the Earth's orbit?
8COMMENT t(r)=root(2/(gamma*m(sun))*integral from 1/3RE to RE (r/root(r-1/3 RE)) dr
9
10ENVIRONMENT DIVISION
11ENGINE Anabrid-THAT
12TIMEBASE 100ms # use SLOW on both integrators
13REQUIRES COEFFICIENT 3, INTEGRATOR 2, COMPARATOR 1, SUMMER 1, OPEN-AMP 2, MULTIPLIER 2, INVERTER 1
14
15DATA DIVISION
16OUTPUT OUTPUT.X -xlimited
17OUTPUT OUTPUT.Y result
18COEFFICIENT.1 Factor # root(2/(gamma*m)), scaled to 0,142 10kd/Tm^3/2
19COEFFICIENT.2 RE # Earth's orbital radius, scaled to 0,150 Tm
20COEFFICIENT.3 1/3RE # note: dependent on RE, scaled to 0,05 Tm
21
22PROGRAM DIVISION
23+1 -> COEFFICIENT.RE -> RE
24+1 -> COEFFICIENT.1/3RE -> 1/3RE
25
26# obtaining x through integration of 1, starting at 1/3RE
27+1, IC:1/3RE -> INTEGRATOR -> -x
28
29# limiting x to the upper limit of the integral RE and set x=0 if beyond
30A:-x, B:RE, GT0:-x -> COMPARATOR -> -xlimited
31
32-xlimited, 1/3RE -> SUMMER -> -(-x+1/3RE)=x-1/3RE
33
34# root of x-1/3RE
35## first invert because the input of a root has to be negative
36x-1/3RE -> INVERTER -> -(x-1/3RE)
37## now make sure the input is never >0 (which causes the circuit to error)
38A:-(x-1/3RE), LT0:-(x-1/3RE) -> COMPARATOR -> -(x-1/3RE)limited
39## now calculate the root
40-(x-1/3RE)limited, OA1 -> OPEN-AMP -> root
41root, root -> MULTIPLIER -> OA1
42
43# x/root
44-xlimited, OA2 -> OPEN-AMP -> x/root
45x/root, root -> MULTIPLIER -> OA2
46
47# integral
48x/root -> INTEGRATOR -> integral
49integral -> COEFFICIENT.Factor -> result
50
51OPERATION DIVISION
52MODE REPEAT
53OP-TIME 111ms